# coding:utf-8
#
import requests
from lxml import etree


url = 'http://www.dxy.cn/bbs/thread/626626#626626'
headers = {'User-Agent': 'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.163 Safari/537.36'}

res = requests.get(url, headers=headers)
# print(res.text)
tree = etree.HTML(res.text)
# print(tree)
auth = tree.xpath('//div[@class="auth"]/a')
content = tree.xpath('//td[@class="postbody"]')
# print(len(auth))
# print(len(content))
for index, i in enumerate(content):
    print('author=', auth[index].xpath('text()')[0],  i.xpath('string(.)').strip())
    print('*'*100)
